package com.winhxd.b2c.customer.service;


import com.winhxd.b2c.common.domain.PagedList;
import com.winhxd.b2c.common.domain.customer.condition.CustomerDistributorCondition;
import com.winhxd.b2c.common.domain.customer.condition.DistributorQueryCondition;
import com.winhxd.b2c.common.domain.customer.vo.CustomerDetailVO;
import com.winhxd.b2c.common.domain.customer.vo.CustomerDistributorSimpleVO;
import com.winhxd.b2c.common.domain.customer.vo.CustomerDistributorVO;
import com.winhxd.b2c.common.domain.customer.vo.CustomerUserInfoVO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


/**
 * @author wangzekun zhaoyanbiao
 * @Description: 分销商模块
 * @date 2019.01.07 15.00
 */
public interface DistributorService {

    /**
     * 保存一级分销商
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    Boolean saveFirstDistributer(CustomerDistributorCondition condition) ;

    /**
     * 分销商列表查询
     * @param condition
     * @return
     */
    PagedList<CustomerDistributorVO> findDistributerListByCondition(CustomerDistributorCondition condition);

    /**
     * 一级分销商换绑
     * @param condition
     * @return
     */
    Boolean modifyFirstDistributorBind(CustomerDistributorCondition condition);


    /**
     * 二级分销商换绑
     * @param condition
     * @return
     */
    Boolean modifySecondDistributorBind(CustomerDistributorCondition condition);

    /**
     * 修改分销商状态
     * @param condition
     * @return
     */
    Boolean modifyDistributorStatus(CustomerDistributorCondition condition);

    /**
     * 根据主键查询分销商换绑所需的简单信息
     * @param id
     * @return
     */
    CustomerDistributorSimpleVO findDistributerSimpleById(Long id);

    /**
     * 根据主键查询分销商换绑所需的详细信息
     * @param id
     * @return
     */
    CustomerDetailVO findDistributerDeatilById(Long id);


    /**
     * 后台保存分销商详情信息
     * @param condition
     * @return
     */
    Boolean modifyDistributor(CustomerDistributorCondition condition);


    /**
     * @param condition
     * @return  CustomerStoreVO
     * @author wangzekun
     * @date 2019/1/15
     * @Description 根据渠道ID和等级查询分销商信息
     */
    List<CustomerUserInfoVO> findDistributorListByChannelIdAndLevel(CustomerDistributorCondition condition);



    /**
     * 会员换绑
     * @param condition
     * @return
     */
    Boolean modifyMemberDistributorBind(CustomerDistributorCondition condition);


    /**
     * 获取分销商下的会员列表
     * @param condition
     * @return
     */
    List<CustomerUserInfoVO> findDistributorMemberList(DistributorQueryCondition condition);


    /**
     * 校验手机号是否在员工表的账号和手机号字段中
     * @param mobile
     */
    void  verfySysUserMobile(String mobile,Long id);

}
